home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / maksiu / lists / amoslist-1197.lzh / AMOSLIST / 000067_amos-request@svcs1.digex.net_Fri Nov 7 15:49:14 1997.msg < prev    next >
Internet Message Format  |  1997-12-04  |  2KB

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail4.access.digex.net (8.8.5/8.8.5) with ESMTP id PAA15977
  3.     for <mcox@access.digex.net>; Fri, 7 Nov 1997 15:47:58 -0500 (EST)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id NAA28455
  6.     for amos-out; Fri, 7 Nov 1997 13:02:16 -0500 (EST)
  7. Received: from mail2.access.digex.net (mail2.access.digex.net [205.197.247.3])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id NAA28452
  9.     for <amos-list@svcs1.digex.net>; Fri, 7 Nov 1997 13:02:15 -0500 (EST)
  10. Received: from MCSDEV.MCS.CO.UK (SYSTEM@mcsdev.mcs.co.uk [193.32.50.112])
  11.     by mail2.access.digex.net (8.8.5/8.8.5) with SMTP id NAA24059
  12.     for <amos-list@access.digex.net>; Fri, 7 Nov 1997 13:02:13 -0500 (EST)
  13. Date:     Fri, 7 Nov 1997 18:03 GMT
  14. From: "SIMONC%MARS.decnet"@mcs.co.uk (Simon Champion - simonc@mcs.co.uk)
  15. Message-Id: <009BCF2FE3D2B080.5392@mcs.co.uk>
  16. To: amos-list@access.digex.net
  17. Subject:  Re: quick question
  18. X-VMS-To: MCSDEV::SMTP%"amos-list@access.digex.net"
  19. Status: O
  20. X-Status: 
  21.  
  22. >From:    MCSDEV::SMTP%"mattw@netsoc.ucd.ie"      "Matt Ward"  7-NOV-1997 15:05:27.84
  23. >To:    Amos-List <amos-list@access.digex.net>
  24. >Subj:    a quick question
  25.  
  26. >Hi all!
  27. >Anyone got anyideas on this one:
  28.  
  29. >I want to use a three character string eg "ADC" or something.
  30. >Now suppose I want to change one character to "E" by removing the
  31. >lowest in this case "A". Is there a way of doing this quickly (ie in
  32. >one line) , no matter where the lowest is?
  33.  
  34. >Or I could do it that I keep adding letters to the string and then I
  35. >need a fast (very) way of picking out the highest 3 letters. Any
  36. >ideas???
  37.  
  38. --------------------------------------
  39.  
  40. You need to use Asc() to get the ASCII values of each character, and
  41. compare them.
  42.  
  43. Try something like this:
  44. (this routine should work for any length of string)
  45.  
  46.     For COUNT=1 to Len(THE_STRING)-1
  47.         If Asc(Mid$(THE_STRING,COUNT,1))>HIGHEST Then HIGHEST=COUNT
  48.     Next
  49.  
  50. In some other languages, it's much easier than this. Amos may have it's
  51. good points, but it can't do everything the easiest way  :-}
  52.  
  53. That's all for now....
  54.  
  55.      Simon Champion.
  56.  
  57. -------------------------------------------------------------------------------
  58. "If in doubt... blame it on Simon  :-( "